import React,{Component} from "react"
import $ from "jquery"
export default class FoldingAnimation extends Component {

	//点击头像跳转
	otheruser(e){
		let el=e.target||e.srcElement
		let imgEl=$(el)
		let username=imgEl.next().html()
		window.location="/user/"+username
	}

	render(){
		return (
			<div id="wrap">
				<div>
					<span>
						<p>
							<img onClick={(e)=>this.otheruser(e)} className="animation-img" src={"/img/"+this.props.span1.avatar} alt="头像" width="35px" height="35px"/>
							<i className="animation-i">{this.props.span1.username}</i>
						</p>
						<p className="animation-p">{this.props.span1.sign}</p>
					</span>
					<div>
						<span>
							<p>
								<img onClick={(e)=>this.otheruser(e)} className="animation-img" src={"/img/"+this.props.span2.avatar} alt="头像" width="35px" height="35px"/>
								<i className="animation-i">{this.props.span2.username}</i>
							</p>
							<p className="animation-p">{this.props.span2.sign}</p>
						</span>
						<div>
							<span>
								<p>
									<img onClick={(e)=>this.otheruser(e)} className="animation-img" src={"/img/"+this.props.span3.avatar} alt="头像" width="35px" height="35px"/>
									<i className="animation-i">{this.props.span3.username}</i>
								</p>
								<p className="animation-p">{this.props.span3.sign}</p>
							</span>
							<div>
								<span>
									<p>
										<img onClick={(e)=>this.otheruser(e)} className="animation-img" src={"/img/"+this.props.span4.avatar} alt="头像" width="35px" height="35px"/>
										<i className="animation-i">{this.props.span4.username}</i>
									</p>
									<p className="animation-p">{this.props.span4.sign}</p>
								</span>
								<div>
									<span>
										<p>
											<img onClick={(e)=>this.otheruser(e)} className="animation-img" src={"/img/"+this.props.span5.avatar} alt="头像" width="35px" height="35px"/>
											<i className="animation-i">{this.props.span5.username}</i>
										</p>
										<p className="animation-p">{this.props.span5.sign}</p>
									</span>
									<div>
										<span>
											<p>
												<img onClick={(e)=>this.otheruser(e)} className="animation-img" src={"/img/"+this.props.span6.avatar} alt="头像" width="35px" height="35px"/>
												<i className="animation-i">{this.props.span6.username}</i>
											</p>
											<p className="animation-p">{this.props.span6.sign}</p>
										</span>
										<div>
											<span>
												<p>
													<img onClick={(e)=>this.otheruser(e)} className="animation-img" src={"/img/"+this.props.span7.avatar} alt="头像" width="35px" height="35px"/>
													<i className="animation-i">{this.props.span7.username}</i>
												</p>
												<p className="animation-p">{this.props.span7.sign}</p>
											</span>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		)
	}
}